// JavaScript Document
function btn_click()
{
	
	var sql="select * from agent where uid='$uid$' and pwd='$pwd$'";
	sql=sql.replace("$uid$",$("#txtUserName").val());
	sql=sql.replace("$pwd$",$("#txtPassword").val());
	var orm=new atiOrmV4();
		orm.obj=sql ;
	orm.callbackFun=function(data)
	{
		
			try{
			  processJavaEx_V2q315(data);
		   }catch(e)
		   {
			 
				 
				  showErr(e);
				  return;
		  
		   }
		   var json=str2json(data);
		   if(json.length==0)
		   {
		   		alert("用户名密码错误");
				return;
		   }
		   
		   
		   
		   	
		   
	};
	
	
	
	// orm.query();
	
	$iocx="com.attilax.ioc.Ioc4agent";
	  var code="new(com.attilax.user.AgentService).login4hiagt($uid$,$pwd$)";
	code=code.replace("$uid$",$("#txtUserName").val());
	code=code.replace("$pwd$",$("#txtPassword").val());
	   var jsb=new AtiJsBridge();
	
		jsb.exe("$code="+encodeURIComponent(code),function(data){
			console.log(data);
			 try{
			  processJavaEx_V2q315(data);
		   }catch(e)
		   {
			 
				if(catchEx(e,"com.attilax.secury.LoginException"))
				  {
					 
							alert("用户名密码错误");
							return;
						//
				  }
				  showErr(e);
				  return;
		  
		   }
		  // alert("login ok");
		   window.location="../uc_hiAgt/uc.htm";
		});
		//////
		
	
	
}